#!/bin/bash

set -e

#DEBHELPER#

case "$1" in
    configure)
        # initial setup
        /usr/share/zentyal/initial-setup --no-restart dhcp $2

        # restart module
        zs dhcp restart || true

        dpkg-trigger --no-await zentyal-core
    ;;
esac

# TODO: Temporary workaround, remove when new 
# apparmor profiles have been finished
ln -s /etc/apparmor.d/usr.sbin.dhcpd /etc/apparmor.d/disable/
apparmor_parser -R /etc/apparmor.d/usr.sbin.dhcpd

exit 0
